package com.hades.xq.miaoshao.dao;

import com.hades.xq.miaoshao.dataobject.ItemStockDO;
import org.apache.ibatis.annotations.Param;

public interface ItemStockDOMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(ItemStockDO record);

    int insertSelective(ItemStockDO record);

    ItemStockDO selectByPrimaryKey(Integer id);

    ItemStockDO selectByItemID(Integer itemId);

    int updateByPrimaryKeySelective(ItemStockDO record);

    int updateByPrimaryKey(ItemStockDO record);

    /**
     * 扣减库存
     *
     * @param itemId
     * @param amount
     * @return
     */
    int descreaseStock(@Param("itemId") Integer itemId, @Param("amount") Integer amount);
}